#ifndef YCCOREPRESENTERMODEL_H
#define YCCOREPRESENTERMODEL_H

#include "presenter.h"
#include <QList>
#include <QObject>

namespace yc {

class PresenterModel : public QObject
{
    Q_OBJECT
public:
    explicit PresenterModel(QObject* parent = nullptr);
    ~PresenterModel();

    const QList<Presenter*>& presenters() const { return presenters_; }
    Presenter* presenter(int id) const;
    void add(const Presenter& presenter);
    void remove(int id);
    void clear();

    Presenter* find(int platform, const QString& platform_id) const;
    void setPresenterCategory(int id, int category);
    void setPresenterStatus(int id, int status, int active_live, int audience_count,
                            const QDateTime& update_time, int updater);
    void setPresenterStatus(yc::Presenter* presenter, int status, int active_live,
                            int audience_count, const QDateTime& update_time, int updater);

Q_SIGNALS:
    void added(yc::Presenter* presenter, QPrivateSignal);
    void changed(yc::Presenter* presenter, QPrivateSignal);
    void removed(yc::Presenter* presenter, QPrivateSignal);
    void modelAboutToBeReset(QPrivateSignal);
    void modelReset(QPrivateSignal);

private:
    QList<Presenter*> presenters_;
};

} // namespace yc

#endif // YCCOREPRESENTERMODEL_H
